<template>
	<div>
		<a-modal title="请选择您要查看的学院" @ok="handleOk" :visible="visible" @cancel="handleCancel">
			<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 18 }">
				<a-form-item label="学院">
					<a-select :allowClear="true" v-decorator="['departCode', { rules: [{ required: true, message: '请选择部门' }] }]" placeholder="全部" optionFilterProp="children" showSearch>
						<a-select-option v-for="(item, index) in DepartCodeList" :key="index" :value="item.Code">{{ item.Name }}</a-select-option>
					</a-select>
				</a-form-item>
			</a-form>
		</a-modal>
		<!-- <div class="h2">数据查询</div>
		<div id="components-form-demo-advanced-search">
			<a-form class="ant-advanced-search-form home-form" :form="form">
				<a-row :gutter="24">
					<a-col :span="8">
						<a-form-item label="部门">
							<a-select :allowClear="true" v-decorator="['departCode', { rules: [{ required: true, message: '请选择部门' }] }]" placeholder="全部" optionFilterProp="children" showSearch>
								<a-select-option v-for="(item, index) in DepartCodeList" :key="index" :value="item.Code">{{ item.Name }}</a-select-option>
							</a-select>
						</a-form-item>
					</a-col>
					<a-col :span="8">
						<a-button-group size="default" class="option" style="margin-top:4px;">
							<a-button type="primary" @click="handleSearch">搜索</a-button>
							<a-button @click="handleReset">重置</a-button>
						</a-button-group>
					</a-col>
				</a-row>
			</a-form>
		</div> -->
		
	</div>
</template>


<script>
import Func from '@/utils/func';
import Cache from '@/utils/cache';
import { DepartDataDisplay } from '@/api/follow';
const data = [];
export default {
	components: {
	},
	data() {
		return {
			data,
			form: this.$form.createForm(this, {
				name: 'advanced_search'
			}),
			DepartCodeList: [],
			visible:true
		};
	},
	computed: {},
	created() {
		this.getOtherList();
	},
	mounted() {},
	methods: {
		filterOption(input, option) {
			return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
		},
		handleOk(e) {
			e.preventDefault();
			this.form.validateFields((error, values) => {
				let routeData = this.$router.resolve({
				   name: 'echartCollege',
					 query:{
						 departCode:values.departCode,
						 name:this.DepartCodeList.filter(m=>m.Code==values.departCode)[0].Name
					 }
				});
				window.open(routeData.href, '_blank');
			});
		},
		handleCancel() {
			this.form.resetFields();
			this.visible = false
		},
		async getOtherList() {
			let res2 = await DepartDataDisplay('DoGetManageDepartList',{});
			this.DepartCodeList = res2.data.data;
		},
	}
};
</script>

<style lang="less" scoped>
.home-form /deep/.ant-form-item {
	display: flex;
	margin-bottom: 10px !important;
}
.home-form /deep/.ant-form-item-label {
	width: 80px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-align: right;
}
.home-form /deep/.ant-form-item-control-wrapper {
	flex: 1;
}
/deep/.el-table th.is-leaf {
	background: #fafafa;
}
/deep/.el-table td,
/deep/.el-table th {
	padding: 5px;
}
.option {
	margin-top: 0px;
	margin-bottom: 20px;
	overflow: hidden;
	.ant-btn {
		font-size: 12px;
	}
}
.foot {
	text-align: center;
	margin-top: 100px;
}
.el-pagination {
	margin-top: 10px;
}
</style>
